package weibo;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Xinxijianyan {
	public Boolean yanzhengBirthday(String birthday) {
		String pat = "\\d{4}-\\d{2}-\\d{2}";
		Pattern p = Pattern.compile(pat);
		Matcher m = p.matcher(birthday);
		if (m.matches()) {
			return true;
		} else {
			return false;
		}
	}

	public Boolean yanzhengNumber(String number) {
		String pat = "(13|17|15|18)+\\d{9}";
		Pattern p = Pattern.compile(pat);
		Matcher m = p.matcher(number);
		if (m.matches()) {
			return true;
		} else {
			return false;
		}
	}

	public Boolean yanzhengEmail(String email) {
		String pat = "\\w+@\\w+.(com|com.cn|cn)";
		Pattern p = Pattern.compile(pat);
		Matcher m = p.matcher(email);
		if (m.matches()) {
			return true;
		} else {
			return false;
		}
	}
}
